Repository navigation
feat: add --schema and --data options for email and phone provider commands - #1705
ramya18101 wants to merge 7 commits into
Conversation
developerkunal
left a comment
There was a problem hiding this comment.
Thanks for this. The five commands follow the same pattern as the other groups, and build, unit tests, lint and the docs check all pass. I also ran every command live against a dev tenant, and --schema, --query and --data behaved as expected. There are two things to fix before this can merge, and one question. Details are in the inline comments.
| return err | ||
| } | ||
| if provided { | ||
| return createEmailProviderFromJSON(cli, cmd, payload) |
There was a problem hiding this comment.
Question, not blocking. For a custom email provider, creating it with flags works without credentials (the help example does exactly that, and the API accepts it). Creating the same thing with --data is rejected locally with schema validation failed: property "credentials" is missing, because the OpenAPI schema marks credentials as required. Is that gap intended? If not, it may be worth a follow-up so an agent can reproduce the custom example through --data.
🔧 Changes
Extends the JSON-input / schema-discovery flag surface (already on
actions,roles,users,apis,apps,connections,logs,domains,email templates,universal-login, andacul config) to the email and phone provider commands, so agents and automation get the same whole-payload and schema-discovery interface. All flags reuse the existing shared helpers (internal/cli/schema.go,data_json.go,query_json.go); no new flag machinery was introduced.The flags
--schema: prints the OpenAPI request/query schema for the operation and exits (combine with--json/--json-compactfor machine-readable output).--data: whole-payload JSON for create/update: inline JSON,@file.json, or piped stdin; validated against the OpenAPI schema before the API is called.--query/-q: JSON object of query parameters for list commands.Per command
email provider create--data+--schema(POST/emails/provider)email provider update--data+--schema(PATCH/emails/provider)phone provider list--schema+--query(GET/branding/phone/providers)phone provider create--data+--schema(POST/branding/phone/providers)phone provider update--data+--schema(PATCH/branding/phone/providers/{id})Notable decisions
--datais mutually exclusive with every granular input flag viamarkDataExclusive, matching the other groups.--data,email provider updateandphone provider updateskip the pre-read and the interactive prompts and send the payload verbatim.--schemareturns before the provider ID is resolved, sophone provider update --schemaneeds no ID.📚 References
🔬 Testing
Manual smoke (against a tenant, non-mutating):
📝 Checklist
🤖 Generated with Claude Code